<html>
<head><meta charset="utf-8"><title>Disjunction · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html">Disjunction</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="247728997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247728997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247728997">(Jul 30 2021 at 16:14)</a>:</h4>
<p>So <span class="user-mention" data-user-id="116113">@lqd</span> I see why you don't love the "copy-and-paste" approach in <a href="https://github.com/rust-lang-nursery/polonius/issues/157">polonius#157</a></p>



<a name="247729006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729006">(Jul 30 2021 at 16:14)</a>:</h4>
<p>One thing I'm wondering about</p>



<a name="247729012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729012">(Jul 30 2021 at 16:14)</a>:</h4>
<p>right :)</p>



<a name="247729024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729024">(Jul 30 2021 at 16:14)</a>:</h4>
<p>I know at some point we had a datalog-to-datafrog compiler</p>



<a name="247729048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729048">(Jul 30 2021 at 16:14)</a>:</h4>
<p>somewhat</p>



<a name="247729049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729049">(Jul 30 2021 at 16:14)</a>:</h4>
<p>which I guess never got quite good enough etc etc to really use here?</p>



<a name="247729065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729065">(Jul 30 2021 at 16:14)</a>:</h4>
<p>but I was wondering-- maybe we can leverage macro-rules?</p>



<a name="247729085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729085">(Jul 30 2021 at 16:14)</a>:</h4>
<p>not to let you write <em>datalog</em> really</p>



<a name="247729102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729102">(Jul 30 2021 at 16:15)</a>:</h4>
<p>but these are all leapjoins</p>



<a name="247729105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729105">(Jul 30 2021 at 16:15)</a>:</h4>
<p>(<a href="https://github.com/lqd/datapond/">https://github.com/lqd/datapond/</a>) it specifically doesn't handle leapjoins yet</p>



<a name="247729140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729140">(Jul 30 2021 at 16:15)</a>:</h4>
<p>I could imagine a macro like</p>



<a name="247729300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729300">(Jul 30 2021 at 16:16)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="n">leapjoin</span><span class="o">!</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">subset</span><span class="w"> </span><span class="o">&lt;-</span><span class="w"> </span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="n">cfg_edge</span><span class="p">.</span><span class="n">extend_with</span><span class="p">(</span><span class="o">|&amp;</span><span class="p">(</span><span class="n">_origin1</span><span class="p">,</span><span class="w"> </span><span class="n">_origin2</span><span class="p">,</span><span class="w"> </span><span class="n">point1</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="n">point1</span><span class="p">),</span><span class="w"></span>
<span class="w">        </span><span class="p">(</span><span class="w"></span>
<span class="w">            </span><span class="n">origin_live_on_entry_rel</span><span class="p">.</span><span class="n">extend_with</span><span class="p">(</span><span class="o">|&amp;</span><span class="p">(</span><span class="n">origin1</span><span class="p">,</span><span class="w"> </span><span class="n">_origin2</span><span class="p">,</span><span class="w"> </span><span class="n">_point1</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="n">origin1</span><span class="p">),</span><span class="w"> </span><span class="c1">// -&gt; A</span>
<span class="w">            </span><span class="n">placeholder_origin</span><span class="p">.</span><span class="n">filter_with</span><span class="p">(</span><span class="o">|&amp;</span><span class="p">(</span><span class="n">_origin1</span><span class="p">,</span><span class="w"> </span><span class="n">origin2</span><span class="p">,</span><span class="w"> </span><span class="n">_point1</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="p">(</span><span class="n">origin2</span><span class="p">,</span><span class="w"> </span><span class="p">())),</span><span class="w"></span>
<span class="w">        </span><span class="p">);</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="o">..</span><span class="p">.</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="o">..</span><span class="p">.</span><span class="w"> </span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="o">&amp;</span><span class="p">(</span><span class="n">origin1</span><span class="p">,</span><span class="w"> </span><span class="n">origin2</span><span class="p">,</span><span class="w"> </span><span class="n">_point1</span><span class="p">),</span><span class="w"> </span><span class="o">&amp;</span><span class="n">point2</span><span class="o">|</span><span class="w"> </span><span class="p">(</span><span class="n">origin1</span><span class="p">,</span><span class="w"> </span><span class="n">origin2</span><span class="p">,</span><span class="w"> </span><span class="n">point2</span><span class="p">),</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="247729322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729322">(Jul 30 2021 at 16:17)</a>:</h4>
<p>egads not that but maybe you get the idea :)</p>



<a name="247729335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729335">(Jul 30 2021 at 16:17)</a>:</h4>
<p>I do :)</p>



<a name="247729347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729347">(Jul 30 2021 at 16:17)</a>:</h4>
<p>something to handle the basic structure of "common things then some options"</p>



<a name="247729364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729364">(Jul 30 2021 at 16:17)</a>:</h4>
<p>I suspect there were more common things than I identified</p>



<a name="247729406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729406">(Jul 30 2021 at 16:17)</a>:</h4>
<p>I wouldn't want to land the PR as-is with these copy-pastes, a macro, some changes in datafrog -- (rather than using the datalog-to-datafrog compiler, since it would generate the same thing if we didn't use it as a proc macro) -- would be good of course. So the PR was to show how verbose this was. And to discuss the more theoretical question about the implicit antijoin that now would need to be explicit (if I didn't make any silly mistakes in my analysis at the time)</p>



<a name="247729773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729773">(Jul 30 2021 at 16:21)</a>:</h4>
<p>and whether you all agreed about the approach to fix how we model the placeholders' liveness</p>



<a name="247729794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247729794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247729794">(Jul 30 2021 at 16:21)</a>:</h4>
<p>it's not that big of a deal of course, but it also allowed to be closer to the rules document that we have (albeit at a potential nontrivial cost in readability and verboseness, depending on the way we'd do it)</p>



<a name="247731416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Disjunction/near/247731416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Disjunction.html#247731416">(Jul 30 2021 at 16:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Polonius.20Hackathon.202021-07-30/near/247728276">said</a>:</p>
<blockquote>
<p>maybe rebase it after landing <a href="https://github.com/rust-lang-nursery/polonius/issues/156">polonius#156</a>?</p>
</blockquote>
<p>done, the diff is now more palatable</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>